package com.zzyl.controller.customer;


import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.entity.NursingProject;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/orders/project")
@Api(tags = "客户预约项目管理")
@Slf4j
public class CustomerOrdersProjectController {

    @Autowired
    private NursingProjectService nursingProjectService;

    @GetMapping("/page")
    public ResponseResult<PageResponse<NursingProjectVo> > page(Integer pageNum, Integer pageSize, String name, Integer status) {
        PageResponse<NursingProjectVo> page = nursingProjectService.queryPage(name,pageNum, pageSize,status);
        return ResponseResult.success(page);
    }


    @GetMapping("/{id}")
    public ResponseResult<NursingProjectVo> getById(@PathVariable("id") Long id) {
        NursingProjectVo nursingProjectVo = nursingProjectService.getById(id);
        return ResponseResult.success(nursingProjectVo);
    }





}
